<template>
  <div>
  <el-row>
    <el-col :span="4"></el-col>
    <el-col :span="12">
      <h1>订单详情</h1>
      <p>订单号:   {{order.id}}</p>
      <p>收货人:   {{order.receiver}}</p>
      <p>送货地址:       {{order.address}}</p>
      <p>收货人电话:       {{order.phone}}</p>
      <p>下单时间:       {{order.date}}</p>
      <p>订单状态:       {{order.status}}</p>
      <!--表格-->
      <el-table :data="order.detailList" border style="width: 100%">
        <el-table-column prop="product.id" label="商品编号"/>
        <el-table-column prop="product.name" label="商品名"/>
        <el-table-column prop="product.price" label="单价"/>
        <el-table-column prop="num" label="购买数量"/>
      </el-table>
    </el-col>
  </el-row>

    <el-row>
      <el-button type="info" @click="$router.push('/index')">返回首页</el-button>
    </el-row>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      order:{}
    }
  }, methods: {
    findById() {
      let id = this.$route.query.id;
    axios.get("/project/order/findById",{params:{id}}).then(resp=>{
      this.order=resp.data;
    })
    }
  },created(){
    this.findById()
  }
}
</script>

<style scoped>

</style>